<!DOCTYPE html>
<html lang="en"
      xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>授权</title>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap-theme.min.css" rel="stylesheet"/>
</head>
<body class="container">
<div class="header">
    <h1 style=" margin-left: 100px">用户授权</h1>
</div>
<div style="margin-top: 50px">
    <form class="form-horizontal"   th:action="@{/pe/peUserManage/sqPeUser}" th:object="${peUser}" method="post">
        <input type="hidden" name="id" th:value="*{id}"/>
        <div class="form-group">
            <label for="role" class="col-sm-2 control-label">用户授权</label>
            <div class="col-sm-10" th:each="role:${peRoles}">
                <input type="checkbox" name="role" id="role" th:value="${role.id}" th:text="${role.getName()}"
                       th:checked="${peUser.getRolesNames().contains(role.getName()) ? true : false }"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <input type="submit" value="Submit" class="btn btn-info" />
                &nbsp; &nbsp; &nbsp;
                <a onclick="javascript:window.history.go(-1)" class="btn btn-info">返回</a>
            </div>
        </div>
    </form>
</div>
</body>
</html>